Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc Python update / signal / child-workflow features #361

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

dandavison
Copy link
Contributor

@dandavison dandavison commented Oct 27, 2023

No description provided.

@dandavison
Copy link
Contributor Author

Added all my non-typescript outstanding changes to this PR, so it now contains

  • New features update/basic_async and signal/child_workflow, with Python implementations
  • A Python implementation for update/basic and signal/basic

@dandavison dandavison changed the title Python signal/basic and signal/child_workflow Non-typescript update-related features Oct 27, 2023
@dandavison dandavison changed the title Non-typescript update-related features Non-typescript Update-related features Oct 27, 2023
Copy link
Member

@cretz cretz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just minor things, gonna have to wait until update releases of course (hopefully soon)

features/signal/basic/feature.py Outdated Show resolved Hide resolved
features/signal/child_workflow/feature.py Outdated Show resolved Hide resolved
features/signal/basic/feature.py Outdated Show resolved Hide resolved
features/signal/child_workflow/feature.py Outdated Show resolved Hide resolved
Comment on lines 8 to 10
CHILD_WORKFLOW_INPUT = "child-input"
CHILD_WORKFLOW_INITIAL_STATE = "1"
SIGNAL_ARG = "2"
Copy link
Member

@cretz cretz Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't have to change, but for me extracting constants out in these tiny tests doesn't have much value

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree I had too many constants. I think I still like one or two of them where they are repeated several times and critical to test logic.

@workflow.defn
class ChildWorkflow:
def __init__(self) -> None:
self._state = CHILD_WORKFLOW_INITIAL_STATE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self._state = CHILD_WORKFLOW_INITIAL_STATE
self._state: Optional[str] = None

Instead of constants, but this is pedantic, don't have to change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, agree that's a cleaner form for the initial state. Taken.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May want to apply to other features in this PR

features/update/basic/feature.py Outdated Show resolved Hide resolved
features/update/basic_async/feature.py Outdated Show resolved Hide resolved
Copy link
Member

@Sushisource Sushisource left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding these!

Copy link
Member

@cretz cretz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (but has to wait on Python release to merge of course)

@dandavison dandavison marked this pull request as draft October 27, 2023 17:34
@dandavison
Copy link
Contributor Author

Thanks for reviewing. I've converted this to draft as a marker that it can't be merged yet.

@dandavison dandavison marked this pull request as ready for review January 18, 2024 13:36
@dandavison dandavison force-pushed the non-update-features branch 2 times, most recently from a5998b4 to 3ab582e Compare January 18, 2024 14:19
@dandavison dandavison merged commit 8946823 into temporalio:main Jan 18, 2024
18 checks passed
@dandavison dandavison deleted the non-update-features branch January 18, 2024 14:29
@dandavison dandavison changed the title Non-typescript Update-related features Misc Python update / signal / child-workflow features Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants